package com.cabd.service.impl;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.ServletOutputStream;

import com.cabd.service.DownLoadService;

public class DownLoadServiceImpl implements DownLoadService {

	@Override
	public void DownLoadFile(ServletOutputStream out, String path) throws IOException {
		InputStream inputStream = new FileInputStream(path);
		int len = 0;
		byte[] buffer = new byte[1024];
		while((len=inputStream.read(buffer))>0){
			out.write(buffer, 0, len);
		}
		inputStream.close();
	}

}
